Nernst Equations Mathematical Derivation